class P621 {

	public static void main(String[] args) {
		int cases = Integer.parseInt(readLn());
		for (int k = 0; k < cases; k++) {
			process(readLn());
		}
	}

//	+ positive result 		 S = 1 or S = 4 or S = 78 
//
//	- negative result 		 S = S35 
//
//	* experiment failed 		 S = 9S4 
//
//	? experiment not completed 		 S = 190S
	
	private static void process(String s) {
		if (s.equals("1") || s.equals("4") || s.equals("78")) {
			System.out.println("+");
		} else if (s.charAt(s.length()-1) == '5' && s.charAt(s.length()-2) == '3') {
			System.out.println("-");
		} else if (s.charAt(0) == '9' && s.charAt(s.length()-1) == '4') {
			System.out.println("*");
		} else if (s.charAt(0) == '1' && s.charAt(1) == '9' && s.charAt(2) == '0') {
			System.out.println("?");
		}

	}

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuffer buffer = new StringBuffer();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString()).trim();
	}

}